window.onload = function () {
    // liftSlip();
    iscrollLeft();
    iscrollRight();
}
function liftSlip() {
    var parent = document.querySelector(".cate_left");
    var ul = parent.querySelector("ul");

    var startY = 0;
    var distanceY = 0;

    //记录初始位置，改变初始位置并根据初始位置进行位移
    var currentY = 0;
    ul.addEventListener("touchstart",function (e) {
        startY = e.touches[0].clientY;
    });
    ul.addEventListener("touchmove",function (e) {

        var moveY = e.touches[0].clientY;
        distanceY = moveY - startY;
        var translateY = distanceY + currentY;

        ul.style.transform = "translateY("+translateY+"px"+")";
        ul.style.webkitTransform = "translateY("+translateY+"px"+")";
    });
    ul.addEventListener("touchend",function (e) {
        currentY = distanceY+currentY;
        startY = 0;
        distanceY = 0;

    });
}
function iscrollLeft() {
    new IScroll(document.querySelector(".cate_left"));
}
function iscrollRight() {
    new IScroll(document.querySelector(".cate_right"),{
        scrollX:true,
        scrollY:false
    });
}